body {
  padding: 2vw;
  text-align: center;
}

ul {
  margin: 20px 0;
  padding: 0;
}

li,
p,
span {
  display: inline-block;
  width: 50px;
  height: 50px;
  background: orange;
  margin: 5px;
  line-height: 50px;
  color: #fff;
  font-weight: bold;
  font-size: 1em;
}

li:nth-last-child(-n + 5) {
  background: #f36;
}

p:nth-last-of-type(-n + 3) {
  background: #893;
}

span:last-of-type {
  background: #e89;
}
